﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WindowsFormsApplication2;
using WindowsFormsApplication2.Model;

namespace Anata_Client
{
    public partial class Setting : Form
    {
        ArrayList cabang = new ArrayList();

        public Setting()
        {
            InitializeComponent();

            cabang = Cabang.daftarCabang();
            object[] o = new object[2];

            for (int i = 0; i < cabang.Count; ++i)
            {
                o = (object[])cabang[i];
                cmbCabang.Items.Add(o[1]);
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            object[] o = (object[])cabang[cmbCabang.SelectedIndex];

            Form1.idCabang = (int)o[0];
            this.Close();
        }
    }
}
